package com.huifaapp.mall.adapter;

import android.content.Context;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.huifaapp.mall.R;
import com.huifaapp.mall.bean.InvitationVIPRecordBean;
import com.huifaapp.mall.bean.TribeDetailsBean;
import com.huifaapp.mall.uitils.UtilsImage;
import com.tencent.mm.sdk.openapi.IWXAPI;

import java.util.List;


/**
 * 
* @ClassName: IntroductionPageAdapter 
* @Description: TODO(引导页) 
* @author lijs
* @date 2016年5月11日 下午1:34:37 
*
 */
public class TribeFragmentListviewAdapter extends BaseAdapter {
	private Context context;
	private LayoutInflater inflater;
	private List<TribeDetailsBean.DataBean.ListBean>  list;
	private IWXAPI api;
	private static final int SHARET_WXPYQ = 517;

	public TribeFragmentListviewAdapter(Context context, List<TribeDetailsBean.DataBean.ListBean> list){//, List<String> list) {
		this.context = context;
		this.inflater = LayoutInflater.from(context);
		this.list=list;

	}


	@Override
	public int getCount() {
		return list == null ? 0 : list.size();
	//Integer.MAX_VALUE;
	}

	@Override
	public Object getItem(int position) {
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	public List<TribeDetailsBean.DataBean.ListBean> getList() {
		return list;
	}

	public TribeFragmentListviewAdapter setList(List<TribeDetailsBean.DataBean.ListBean> list) {
		this.list = list;
		return this;
	}

	int ds=0;
	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		final ViewHolder holder;
		if (null == convertView) {
			convertView = inflater.inflate(R.layout.tribefragmentlv_adapter, null);
			holder = new ViewHolder();
			holder.tv_tribe_adapter_title= (TextView) convertView.findViewById(R.id.tv_tribe_adapter_title);
			holder.tv_tribe_adapter_details= (TextView) convertView.findViewById(R.id.tv_tribe_adapter_details);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		final TribeDetailsBean.DataBean.ListBean bean=list.get(position);
		holder.tv_tribe_adapter_title.setText(bean.getTitle());
		holder.tv_tribe_adapter_details.setText(bean.getContent());
		return convertView;
	}


	class ViewHolder {

			private TextView tv_tribe_adapter_title;
			private  TextView tv_tribe_adapter_details;
	}


}